// 标签管理模块相关接口
/**
 * 请求回调
 * @callback requestCallback
 * @param {object} data 请求回调的数据
 */
export default {
	/**
	 * 获取章节知识点配置列表 RC10001
	 * @param {object} opt
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	queryChapterKnowledgeList(opt = {}) {
		Http.callService({
			url: "rc/admin/projectconfig/list"
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**
	 * 获取章节知识点配置详情
	 * @param {object} opt
	 * @param {object} opt.data 请求入参
	 * @param {string} opt.data.theirType 所属类型（C：章节目录  K：知识点）
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	queryChapterKnowledgeInfo(opt = {}) {
		Http.callService({
			url: "rc/admin/projectconfig/get",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**
	 * 编辑章节，知识点配置信息 RC10002
	 * @param {object} opt
	 * @param {object} opt.data 请求入参
	 * @param {string} opt.data.theirType 所属类型（C：章节目录  K：知识点）
	 * @param {string} opt.data.isRequired 是否必填(Y：是；N：否)
	 * @param {string} opt.data.projectIds 项目标识(多个用逗号隔开)
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	editChapterKnowledge(opt = {}) {
		Http.callService({
			url: "rc/admin/projectconfig/put",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//获取资源标签页信息
	getResourceTagList(opt = {}) {
		Http.callService({
			url: "rc/admin/label/list",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//启用或者禁用标签
	onStartOrHidden(opt = {}) {
		Http.callService({
			url: "rc/admin/label/available/state/update",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//获取课程组管理列表页信息
	getClassMangerList(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses/list",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//添加系列课
	addCourseClass(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses/add",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//修改系列课
	editCourseClass(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses/update",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//根据id查看标签详情
	showTableDataItem(opt = {}) {
		Http.callService({
			url: "rc/admin/label/info",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//新增加一个资源标签
	addNewTag(opt = {}) {
		Http.callService({
			url: "rc/admin/label/add",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	//检查标签是否被启用
	checkTag(opt = {}) {
		Http.callService({
			url: "rc/admin/label/use/get",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	editSourseTag(opt = {}) {
		Http.callService({
			url: "rc/admin/label/update",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**
	 * 获取教学阶段
	 * @param {object} opt
	 * @param {object} opt.data 请求入参
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	getTeachStage(opt = {}) {
		Http.callService({
			url: "rc/admin/common/teachstages",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**获取系列课信息
	 * @param {Object} opt
	 * @param {object} opt.data 请求入参
	 * @param {String} opt.data.seriesCourseId 系列课唯一标识
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	getSeriesInfo(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses/info",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**获取标签详细信息列表
	 * @param {Object} opt
	 * @param {object} opt.data 请求入参
	 * @param {String} applyScope 应用范围（Q：题 C：课 H：讲义）
	 * @param {String} labelType 标签类型(S：系统标签 C：自定义标签)
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	getResourceLabels(opt = {}) {
		Http.callService({
			url: "rc/admin/labels",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**
	 * 获取系列课列表 RC10010
	 * @param {object} opt
	 * @param {object} opt.data 请求入参
	 * @param {string} opt.data.projectId 项目标识
	 * @param {string} [opt.data.teachRange] 教学阶段类型F：基础阶段 E：精讲阶段 I：强化阶段 B：考前阶段
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	querySeriesCourses(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses/list",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	},
	/**
	 * 获取教学阶段系列课树状列表 RC50005
	 * @param {object} opt
	 * @param {object} opt.data 请求入参
	 * @param {string} opt.data.projectId 项目标识
	 * @param {requestCallback} [opt.success] 请求成功回调
	 * @param {requestCallback} [opt.complete] 请求完成回调
	 */
	queryCoursesTreeList(opt = {}) {
		Http.callService({
			url: "rc/admin/seriescourses",
			data: opt.data || {}
		})
			.success((data) => {
				opt.success && opt.success(data);
			})
			.complete((data) => {
				opt.complete && opt.complete(data);
			});
	}
};
